Never heard of a health regulation like that, I believe the employee was trying to get you to purchase their own products.
Several years ago, I saw a restaurant manager get fired for this very thing. My father and I were involved with the design and construction of a number of Jack's Hamburger restaurants, popular here in the South. Their corporate offices are here in Alabama, or at least they were almost twenty years ago, anyway. We were eating at a Jack's that we were going to renovate with one of the Jack's corporate VP's, and we watched the manager (who didn't know who we were, or who the VP was) go over to a guy with food from a nearby restaurant, but a Jack's drink. The manager told him he would either have to purchase his whole meal there, or he would have to leave. Before the offended customer could get up out of his seat, the VP had jumped up, chewed out the manager and fired him on the spot in front of the guy, apologized to the man and told him he could have a free burger there for the rest of his life, wrote out a note to the fact and signed it and gave it to the man.
So, I don't think there is any legit health department code that would preclude what you did.
Brandon